dict1 = {'name': 'Tom', 'age': 20, 'gender': '男'}

# del 删除字典或指定的键值对

# del(dict1)
# print(dict1) # 报错

del dict1['name']
print(dict1) # {'age': 20, 'gender': '男'}

# del dict1['ages'] # key不存在，报错，没有ages
# print(dict1)

# clear()
dict1.clear()
print(dict1)
